Integrand size = 21, antiderivative size = 148 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\left (a^4-6 a^2 b^2+b^4\right ) x}{2 \left (a^2+b^2\right )^3}+\frac {2 a b \left (a^2-b^2\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right )^3 d}-\frac {a^2 b}{\left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}-\frac {\cos ^2(c+d x) \left (2 a b+\left (a^2-b^2\right ) \tan (c+d x)\right )}{2 \left (a^2+b^2\right )^2 d} \]
1/2*(a^4-6*a^2*b^2+b^4)*x/(a^2+b^2)^3+2*a*b*(a^2-b^2)*ln(a*cos(d*x+c)+b*si n(d*x+c))/(a^2+b^2)^3/d-a^2*b/(a^2+b^2)^2/d/(a+b*tan(d*x+c))-1/2*cos(d*x+c )^2*(2*a*b+(a^2-b^2)*tan(d*x+c))/(a^2+b^2)^2/d
Time = 3.75 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.66 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {b \left (\frac {\left (a^2-b^2\right ) \left (a^2+b^2\right ) \arctan (\tan (c+d x))}{b}+2 a \left (a^2+b^2\right ) \cos ^2(c+d x)+a \left (2 a^2-2 b^2+\frac {-a^3+3 a b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-4 a (a-b) (a+b) \log (a+b \tan (c+d x))+a \left (2 a^2-2 b^2+\frac {a^3-3 a b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+\frac {(a-b) (a+b) \left (a^2+b^2\right ) \sin (2 (c+d x))}{2 b}+\frac {2 a^2 \left (a^2+b^2\right )}{a+b \tan (c+d x)}\right )}{2 \left (a^2+b^2\right )^3 d} \]
-1/2*(b*(((a^2 - b^2)*(a^2 + b^2)*ArcTan[Tan[c + d*x]])/b + 2*a*(a^2 + b^2 )*Cos[c + d*x]^2 + a*(2*a^2 - 2*b^2 + (-a^3 + 3*a*b^2)/Sqrt[-b^2])*Log[Sqr t[-b^2] - b*Tan[c + d*x]] - 4*a*(a - b)*(a + b)*Log[a + b*Tan[c + d*x]] + a*(2*a^2 - 2*b^2 + (a^3 - 3*a*b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x]] + ((a - b)*(a + b)*(a^2 + b^2)*Sin[2*(c + d*x)])/(2*b) + (2*a^2*(a^2 + b^2))/(a + b*Tan[c + d*x])))/((a^2 + b^2)^3*d)
Time = 0.59 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.40, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3999, 601, 25, 2160, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (c+d x)^2}{(a+b \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 3999 |
\(\displaystyle \frac {b \int \frac {b^2 \tan ^2(c+d x)}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 601 |
\(\displaystyle \frac {b \left (-\frac {\int -\frac {-\frac {\left (a^2-b^2\right ) \tan ^2(c+d x) b^4}{\left (a^2+b^2\right )^2}-\frac {2 a \tan (c+d x) b^3}{a^2+b^2}+\frac {a^2 \left (a^2-b^2\right ) b^2}{\left (a^2+b^2\right )^2}}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2}-\frac {b \left (a^2-b^2\right ) \tan (c+d x)+2 a b^2}{2 \left (a^2+b^2\right )^2 \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {b \left (\frac {\int \frac {-\frac {\left (a^2-b^2\right ) \tan ^2(c+d x) b^4}{\left (a^2+b^2\right )^2}-\frac {2 a \tan (c+d x) b^3}{a^2+b^2}+\frac {a^2 \left (a^2-b^2\right ) b^2}{\left (a^2+b^2\right )^2}}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2}-\frac {b \left (a^2-b^2\right ) \tan (c+d x)+2 a b^2}{2 \left (a^2+b^2\right )^2 \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 2160 |
\(\displaystyle \frac {b \left (\frac {\int \left (\frac {4 a \left (a^2-b^2\right ) b^2}{\left (a^2+b^2\right )^3 (a+b \tan (c+d x))}+\frac {\left (a^4-6 b^2 a^2-4 b \left (a^2-b^2\right ) \tan (c+d x) a+b^4\right ) b^2}{\left (a^2+b^2\right )^3 \left (\tan ^2(c+d x) b^2+b^2\right )}+\frac {2 a^2 b^2}{\left (a^2+b^2\right )^2 (a+b \tan (c+d x))^2}\right )d(b \tan (c+d x))}{2 b^2}-\frac {b \left (a^2-b^2\right ) \tan (c+d x)+2 a b^2}{2 \left (a^2+b^2\right )^2 \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b \left (\frac {-\frac {2 a^2 b^2}{\left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac {2 a b^2 \left (a^2-b^2\right ) \log \left (b^2 \tan ^2(c+d x)+b^2\right )}{\left (a^2+b^2\right )^3}+\frac {4 a b^2 \left (a^2-b^2\right ) \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3}+\frac {b \left (a^4-6 a^2 b^2+b^4\right ) \arctan (\tan (c+d x))}{\left (a^2+b^2\right )^3}}{2 b^2}-\frac {b \left (a^2-b^2\right ) \tan (c+d x)+2 a b^2}{2 \left (a^2+b^2\right )^2 \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
(b*(-1/2*(2*a*b^2 + b*(a^2 - b^2)*Tan[c + d*x])/((a^2 + b^2)^2*(b^2 + b^2* Tan[c + d*x]^2)) + ((b*(a^4 - 6*a^2*b^2 + b^4)*ArcTan[Tan[c + d*x]])/(a^2 + b^2)^3 + (4*a*b^2*(a^2 - b^2)*Log[a + b*Tan[c + d*x]])/(a^2 + b^2)^3 - ( 2*a*b^2*(a^2 - b^2)*Log[b^2 + b^2*Tan[c + d*x]^2])/(a^2 + b^2)^3 - (2*a^2* b^2)/((a^2 + b^2)^2*(a + b*Tan[c + d*x])))/(2*b^2)))/d
3.1.63.3.1 Defintions of rubi rules used
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) *((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[(c + d*x)^n*(a + b*x^2)^(p + 1)*ExpandToSum[(2*a*(p + 1)*Qx)/(c + d*x)^n + (e* (2*p + 3))/(c + d*x)^n, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 1] && LtQ[p, -1] && ILtQ[n, 0] && NeQ[b*c^2 + a*d^2, 0]
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[b/f Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
Time = 2.49 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.16
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-\frac {a^{4}}{2}+\frac {b^{4}}{2}\right ) \tan \left (d x +c \right )-a^{3} b -a \,b^{3}}{1+\tan ^{2}\left (d x +c \right )}+\frac {\left (-4 a^{3} b +4 a \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{4}+\frac {\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{3}}-\frac {a^{2} b}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {2 a b \left (a^{2}-b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(171\) |
default | \(\frac {\frac {\frac {\left (-\frac {a^{4}}{2}+\frac {b^{4}}{2}\right ) \tan \left (d x +c \right )-a^{3} b -a \,b^{3}}{1+\tan ^{2}\left (d x +c \right )}+\frac {\left (-4 a^{3} b +4 a \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{4}+\frac {\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{3}}-\frac {a^{2} b}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {2 a b \left (a^{2}-b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(171\) |
risch | \(-\frac {i x b}{2 \left (3 i b \,a^{2}-i b^{3}-a^{3}+3 a \,b^{2}\right )}-\frac {x a}{2 \left (3 i b \,a^{2}-i b^{3}-a^{3}+3 a \,b^{2}\right )}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{8 \left (-2 i a b +a^{2}-b^{2}\right ) d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{8 \left (2 i a b +a^{2}-b^{2}\right ) d}-\frac {4 i a^{3} b x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {4 i a \,b^{3} x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {4 i a^{3} b c}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {4 i a \,b^{3} c}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {2 i a^{2} b^{2}}{\left (i b +a \right )^{2} d \left (-i b +a \right )^{3} \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+a \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +a \right )}+\frac {2 a^{3} b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {2 a \,b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) | \(451\) |
1/d*(1/(a^2+b^2)^3*(((-1/2*a^4+1/2*b^4)*tan(d*x+c)-a^3*b-a*b^3)/(1+tan(d*x +c)^2)+1/4*(-4*a^3*b+4*a*b^3)*ln(1+tan(d*x+c)^2)+1/2*(a^4-6*a^2*b^2+b^4)*a rctan(tan(d*x+c)))-a^2*b/(a^2+b^2)^2/(a+b*tan(d*x+c))+2*a*b*(a^2-b^2)/(a^2 +b^2)^3*ln(a+b*tan(d*x+c)))
Leaf count of result is larger than twice the leaf count of optimal. 292 vs. \(2 (144) = 288\).
Time = 0.28 (sec) , antiderivative size = 292, normalized size of antiderivative = 1.97 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{3} + {\left (a^{2} b^{3} - b^{5} - {\left (a^{5} - 6 \, a^{3} b^{2} + a b^{4}\right )} d x\right )} \cos \left (d x + c\right ) - 2 \, {\left ({\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right ) + {\left (a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (3 \, a^{3} b^{2} + a b^{4} + {\left (a^{4} b - 6 \, a^{2} b^{3} + b^{5}\right )} d x - {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} d \sin \left (d x + c\right )\right )}} \]
-1/2*((a^4*b + 2*a^2*b^3 + b^5)*cos(d*x + c)^3 + (a^2*b^3 - b^5 - (a^5 - 6 *a^3*b^2 + a*b^4)*d*x)*cos(d*x + c) - 2*((a^4*b - a^2*b^3)*cos(d*x + c) + (a^3*b^2 - a*b^4)*sin(d*x + c))*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) - (3*a^3*b^2 + a*b^4 + (a^4*b - 6*a^2*b^3 + b^5)*d*x - (a^5 + 2*a^3*b^2 + a*b^4)*cos(d*x + c)^2)*sin(d*x + c))/((a^7 + 3*a^5*b^2 + 3*a^3*b^4 + a*b^6)*d*cos(d*x + c) + (a^6*b + 3*a^4*b^3 + 3*a^ 2*b^5 + b^7)*d*sin(d*x + c))
Timed out. \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\text {Timed out} \]
Leaf count of result is larger than twice the leaf count of optimal. 293 vs. \(2 (144) = 288\).
Time = 0.53 (sec) , antiderivative size = 293, normalized size of antiderivative = 1.98 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} {\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {4 \, {\left (a^{3} b - a b^{3}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {2 \, {\left (a^{3} b - a b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {4 \, a^{2} b + {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{2} + {\left (a^{3} + a b^{2}\right )} \tan \left (d x + c\right )}{a^{5} + 2 \, a^{3} b^{2} + a b^{4} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \tan \left (d x + c\right )^{3} + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \tan \left (d x + c\right )^{2} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \tan \left (d x + c\right )}}{2 \, d} \]
1/2*((a^4 - 6*a^2*b^2 + b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + 4*(a^3*b - a*b^3)*log(b*tan(d*x + c) + a)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 2*(a^3*b - a*b^3)*log(tan(d*x + c)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^ 2*b^4 + b^6) - (4*a^2*b + (3*a^2*b - b^3)*tan(d*x + c)^2 + (a^3 + a*b^2)*t an(d*x + c))/(a^5 + 2*a^3*b^2 + a*b^4 + (a^4*b + 2*a^2*b^3 + b^5)*tan(d*x + c)^3 + (a^5 + 2*a^3*b^2 + a*b^4)*tan(d*x + c)^2 + (a^4*b + 2*a^2*b^3 + b ^5)*tan(d*x + c)))/d
Time = 0.51 (sec) , antiderivative size = 263, normalized size of antiderivative = 1.78 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} {\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {2 \, {\left (a^{3} b - a b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {4 \, {\left (a^{3} b^{2} - a b^{4}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}} - \frac {3 \, a^{2} b \tan \left (d x + c\right )^{2} - b^{3} \tan \left (d x + c\right )^{2} + a^{3} \tan \left (d x + c\right ) + a b^{2} \tan \left (d x + c\right ) + 4 \, a^{2} b}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} {\left (b \tan \left (d x + c\right )^{3} + a \tan \left (d x + c\right )^{2} + b \tan \left (d x + c\right ) + a\right )}}}{2 \, d} \]
1/2*((a^4 - 6*a^2*b^2 + b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 2*(a^3*b - a*b^3)*log(tan(d*x + c)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + 4*(a^3*b^2 - a*b^4)*log(abs(b*tan(d*x + c) + a))/(a^6*b + 3*a^4*b ^3 + 3*a^2*b^5 + b^7) - (3*a^2*b*tan(d*x + c)^2 - b^3*tan(d*x + c)^2 + a^3 *tan(d*x + c) + a*b^2*tan(d*x + c) + 4*a^2*b)/((a^4 + 2*a^2*b^2 + b^4)*(b* tan(d*x + c)^3 + a*tan(d*x + c)^2 + b*tan(d*x + c) + a)))/d
Time = 4.79 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.72 \[ \int \frac {\sin ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (\frac {2\,a\,b}{{\left (a^2+b^2\right )}^2}-\frac {4\,a\,b^3}{{\left (a^2+b^2\right )}^3}\right )}{d}-\frac {\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (3\,a^2\,b-b^3\right )}{2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{2\,\left (a^2+b^2\right )}+\frac {2\,a^2\,b}{{\left (a^2+b^2\right )}^2}}{d\,\left (b\,{\mathrm {tan}\left (c+d\,x\right )}^3+a\,{\mathrm {tan}\left (c+d\,x\right )}^2+b\,\mathrm {tan}\left (c+d\,x\right )+a\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (a+b\,1{}\mathrm {i}\right )}{4\,d\,\left (-a^3\,1{}\mathrm {i}-3\,a^2\,b+a\,b^2\,3{}\mathrm {i}+b^3\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (b+a\,1{}\mathrm {i}\right )}{4\,d\,\left (-a^3-a^2\,b\,3{}\mathrm {i}+3\,a\,b^2+b^3\,1{}\mathrm {i}\right )} \]
(log(a + b*tan(c + d*x))*((2*a*b)/(a^2 + b^2)^2 - (4*a*b^3)/(a^2 + b^2)^3) )/d - ((tan(c + d*x)^2*(3*a^2*b - b^3))/(2*(a^4 + b^4 + 2*a^2*b^2)) + (a*t an(c + d*x))/(2*(a^2 + b^2)) + (2*a^2*b)/(a^2 + b^2)^2)/(d*(a + b*tan(c + d*x) + a*tan(c + d*x)^2 + b*tan(c + d*x)^3)) + (log(tan(c + d*x) + 1i)*(a + b*1i))/(4*d*(a*b^2*3i - 3*a^2*b - a^3*1i + b^3)) + (log(tan(c + d*x) - 1 i)*(a*1i + b))/(4*d*(3*a*b^2 - a^2*b*3i - a^3 + b^3*1i))